"""
@File    : HW_object_oriented_programming_Rectangle.py
@Author  : WorldWind(1772830365@qq.com)
@Time    : 2025/7/11
"""


class Rectangle:

    def __init__(self, length, width):
        self.length = length
        self.width = width
        print('This is __init__ method. Rectangle begin')

    def __del__(self):
        print('This is __del__ method. The Rectangle class has been recycled')

    # 矩形面积
    def area(self):
        print(f'The area of this rectangle is {self.length * self.width}㎡')

    # 矩形周长
    def perimeter(self):
        print(f'The perimeter of this rectangle is {(self.length + self.width) * 2}m')


r1 = Rectangle(15, 60)
r1.area()
r1.perimeter()
